public class main5 {
    public static void main(String[] args) {
        int n=111,k=10;
        int sum=0;
        while(n>=k){
            sum+=n%k;
            n=n/k;
        }
        sum+=n;
        System.out.println(sum);
    }
}
